// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial

//include_path: ../../helper_components

global MyGlobal := {
    property <int> hello: 42;
}

export { MyGlobal }
export { MyGlobal as GlobalAlias }

TestCase := Rectangle {
    property <bool> test_global_prop_value: MyGlobal.hello == 100;
}

/*
```rust
let instance = TestCase::new().unwrap();
assert!(!instance.get_test_global_prop_value());
assert_eq!(MyGlobal::get(&instance).get_hello(), 42);
assert_eq!(GlobalAlias::get(&instance).get_hello(), 42);
instance.global::<MyGlobal>().set_hello(100);
assert!(instance.get_test_global_prop_value());
assert_eq!(MyGlobal::get(&instance).get_hello(), 100);
assert_eq!(GlobalAlias::get(&instance).get_hello(), 100);
```

```cpp
auto handle = TestCase::create();
const TestCase &instance = *handle;
assert(!instance.get_test_global_prop_value());
assert_eq(instance.global<MyGlobal>().get_hello(), 42);
assert_eq(instance.global<GlobalAlias>().get_hello(), 42);
instance.global<MyGlobal>().set_hello(100);
assert(instance.get_test_global_prop_value());
assert_eq(instance.global<MyGlobal>().get_hello(), 100);
assert_eq(instance.global<GlobalAlias>().get_hello(), 100);

```

```js
let instance = new slint.TestCase({});
assert(!instance.test_global_prop_value);
// TODO
```

*/
